grammar and syntax cleanup