remove some legacy Py2.[345] code
simplify some code
simplify some code