Refactor socket.io settings