Refactoring and pep8.