Refactoring MongoDatebase class