refactor Lexer