cleaning up javascript.html code