refactored reader.py to isolate stream ops in _Reader