Parser refactoring