Connection refactoring.