various cleanups as suggested by pylint