javascript cleanups