Simplify socket.io io.connect logic