[fix] made genGroup a private function called by addGroup