Connection callback refactoring.