conversion: manage all temp files with a context manager