Refactoring TextReader class