tidy lexer and parsing