simplify tmp directory handler