lexer refactoring