refactor socketio wrapper