moving group key generator func to the config