groups: insert new group with proper type. add new group to table if needed (same type).