capture_stdout extracted.