code reformat and comment cleanup