pep8 and cleanup from @dirk-thomas