Refactoring mktemp.
Refactoring.
Refactoring.
Refactoring.
Refactoring.
Refactoring.
Refactoring.
Refactoring.
Refactoring.
Refactoring.