Add generating upgrade method function.