Massive cleanup and reformatting