refactored parsing process, added removal of html, refactored chain of main