pep8 and pyflakes code cleanup