more parser refactoring