improve extraction generate