almost done with py3 refactor