Updated embedded subs extraction