move slice_collection optimization to utils