Clean up the code, reformat