refactor etcd registration