convert getting groups to HashMap