lexer: Minor refactorings.