improve upgrade task