Refactoring away access to connection streams directly.