Refactored the lexer.