moved socket logic into sockets.js