Eliminate duplication in PipeStub File operations