Cleaning up some more javascript