Code clean up and reformat.