housecleaning (reformat and optimize)