Added clean up phase to scripts