Clean up and format code.