Refactoring for parser