small refactorings for the lexer