More refactorings and PEP-8