Refactor streaming response