refactor mongo_client