Refactor the lexer.