speeding up catefory reordering