Refactor the functions and group listings to have fewer functions, but have them take group names as parameters. Pull group definitions in to a single associative array.