Refactored to create a MongoClient instead of Mongo.