improved generate metadata workflow