Added some more cleaning to the HTML rendering process