Refactor DSL code
Merge branch 'dsl-refactor' into 0.10.x