Group is not empty if has sub-group.
Split code the smaller methods.