remove unnecessary code from socket.io callbacks