Adding cluster state logic and manage node states better