refactored adding and removing a contact to a group