updated readability to pass in html as an option, removed unused extra code