Refine dir structures