refactor code according to pep8