file reading abstraction