[Minor] Refactoring to avoid duplicate code

Very merry end of the year :)
This check is actually useless: we can always ask the metadata factory directly instead