DB connections refactoring