improved temporary file utilities