social connection refactoring