better temporary file handling in wrappers module