code reformat & cleanup