More refactoring of connections.