Metadata provider refactoring