Defensive code to avoid UI crash
When joining or abandoning the cluster, HA network object is updated

 * Also some reordering and refactoring