Please extract this block into a private method, so that it reads line `end_link = extract_truncated_link any_params_you_need`