rebuild the directory structure