Ben: some cleanup of main js process on index.html