improving javascript callbacks
removing commented out code