parser: more refactoring