refactored file streamer