Reformat and remove unused functions.