Refactory GrammarParser