cleanup and convert to html5