update extend function generator