refactor for DSL