Simplify groups array creation.