An easier solution is to name it groupN if the group has more than one layer, or name it after the layer if the group has exactly one layer.
An easier solution is to name it groupN if the group has more than one layer, or name it after the layer if the group has exactly one layer.