reordering build tree