Breaking up Grammar class
grammar refactoring