Reverted back changes to use DelegatingStream instead