grouping by related to resources