Add deleteGroup function, Optimalize