rebuild the file structure