parser refactoring