Better matching in getMetadata