cleaned lexer constructor