Tidy up the rebuilding process