cleanup and expand grammar