move temp file logic to write-to
0.1.8