Small refactoring to make the parser nicer