simplify temp directory handling