2to3 refactoring