Metadata refactoring