add function: group resolve_by