moved all lex stuff into classes