Cleanups on the javascript