Remove unused code.
Don't sort slices, so that generation/consumption stay grouped together as per layer order.