Cleaning up some JS