Refactor parser.