Refactoring with flake8