Create a separate function to delete directories.