Don't iterate over TypeIdsWithinPipelineMap twice. Optimize so setIds are stotred within a pipeline