parser refactor