Refactoring db creation call