housecleaning (optimize and reformat)