use temp dir
possibly premature abstraction