code reformatting and clean up