Re-factoring the qml code.