Refactor launchTask() to use Pipe for stdin too