Loads of Code cleanup and formatting