Minor refactorings to Parser.