Refactored read_file. Now cleaner, leaner, and smaller