refactored stream function: 14.1