refactor metadata into new trait.