refine the directory structure