metadata refactor