grammar modifications + parser refactoring