Refactor grammar to match style.