An ugly implementation of the group macros