refine dir constructure