Drastic refactoring to introduce parsing algorithm 3.0