Refactored the work group-related attributes to use a template, which reduces the amount of duplicate code in the handler. No functional change intended.