tidy up and reset method