Refactors reset script.