Tidy up, save state