Consolidated HTML parsing into just the parseHTML() function