Refactor clone and compile functions

No match.