use portable methods for cleaning up files