refine the hierachy part