rearrange hierarchy