Refactor streams

Add some intermediate variable names.