beautify the html and make a bunch of fixes