Refactoring to have performant parser