extracted commonly used function as makeItemGroup().