factor out grammar and extend it a lot
excessive cleanups before splitting/naming decisions will have to be made..