fixing the QML version, simplifying the JS one and improving both