cleaning up lexing code