Lexer optimization