Reformat diff functions