Refactoring _initDb