refectoring the Lexer iterator