Streamlined code reading the file handles and creating hashes.