simplify stdout capturing