More code cleanup and removed MetadataReadError