Supports group but create trimming mask for each group for some reason. I also want a better logic to group batches.