optimize slices