Refactored lexer's interface