improving internal structure and simplyfing dsl build