flake8 cleanup of code