smart reordering