Minor refactoring for IConnection (unit tests)