Refactored parser. (running gag now)