refine dir structure