refactoring to support better DSL