Move the create group function to a separate method.
This raises an error when the group is first created, as setGroupProperties doesn't exist. It also needs a switch to control whether groups are created on the fly