lexer: Refactoring a bit.