tidy up and upgrade