optimizations in the lexer