Connection and Pairs refactored