Cleaned up some more javascript