clean up some of the javascript