Logging simplification and flake8  pass