refactor so that py2 imports do not stumble anymore