PEP8 and small refactorings.