refine the directory