cleanup and validation of html