code clean and reformat