Refactoring for metadata