clean up of upgrade script