use better strategy to create temp files and folders