Ok, updated the PR to expose/use the existing capture_output as well as address the other issues discussed and rebase/squashed to cleanup. Let me know if you have any other concerns/suggestions. Thx!