Reformat and rearrange code.