make code pep8 compact and reslove a rename error