improved generate/download workflow