Javascript cleanups