refined textfilereader class and related class