Refine the code of C5_8A_RebuildTree