Remove unnecessary directories.