Refactory GrammarFactory