Parser/lexer refactoring