etcd: abstract out mode change logic