Formatting and removal of old code