Cleaned up file reading