Made changes to abstract out functions on zookeeper so that it can be
used across multiple places