move logic out of etcdRead