optimize MongoId handling