More refactoring work, everything respects PEP-8 (I hope)