removing dependence on tempfiles