refactor grammar