Move unwrap_role out of detail