Minor refactoring of parser