Code refactor for metadata structure change;