MongoDBConfig refactor