refactoring mongodb initializing to persistence service