StreamReader refactoring