simplify code
fix refnanny error output in Py3