refactoring in BunGrammar