Reworking the group dialog to reduce code. Currently broken.