temp directory usage optimized