Metadata storage refactored