Add flake8 in tox. Refactoring.