tidy up main