Refactor parser rules