Tidy up of code for re-checking out