Helper for file reading