Refactor out creation versus group handling functions.