Library: safer system for grouping.