Group shelves into similar items.