Group by environment