Refactor DSL module