Clean up and reformat code.