Refactoring

- created a parser class
- updated tests
- updated logic for transform direction