updating variables and cleaning up zookeeper groups