cleanup of ExtractMetadata

log errors in one place instead of everywhere.
more to come...