begining of dsl rewrite