some cleanup of the js