pep8 and some logging