refactoring MongoConfig