common set_metadata