Testing the grammar. Some refactorings.