Refactoring DBManagement