Work on refactoring the parser