refactor MetadataAdapter