Refine dir tree.