Split socketio logic and generic logic.