Fix and refactor model DSL