Refactor transformations and parser