Code cleaned (PEP-8) and refactored to share common QML backend code.