beginning parser refactor