replace groups by communities