[Refactor] - Use os.path.basename to retrieve the filename for the temp folder