Remove unnecessary code in MongoContext