metadataStore serialization refactor