Extracting method for cleaning the temporary directory.