Tidy up of main