Clean up the javascript