flake8 style/formatting changes and migration away from get_profile()