refactoring mongo_setup