Refactoring to get some experience with connections.