This assumes that `result['name']` is not populated, which might be a safe assumption, but I feel like we should only set it if is not set. Or we could just use `result.get('name', 'undefined')` below. Also, we could initially set class_name to 'undefined' and then remove the else.