restructure code
simplify dsl