Refactoring of database connections.