Delete the unnecessary directories.