Refactors mongoDB configuration.