Reworked the code to properly not expand the stream until the final
process loop.