further preparation for upgrade function