refactor for pylint,PEP8