Adds better stream handling in DuplicatoinTaskProcessor