Little bit of refactoring + PEP8 improvements
Refactored sources