more grammar gen optimisations