Clean up connection classes
Use shared_from_this to safely bind this pointer