pep8 code refactoring