Refactor compile.dynamo