reformat and clean up the code
cosmetics