cleanup the grammar