Refactor code according to pep8