extract method execPopen