ZOOKEEPER-2936: Removed duplicate code
ZOOKEEPER-2936: Removed duplicate code

Author: asutosh936 <asutosh.pandya@hotmail.com>

Reviewers: Andor Molnár <andor@cloudera.com>, Abraham Fine <afine@apache.org>

Closes #473 from asutosh936/master and squashes the following commits:

6a17613be [asutosh936] ZOOKEEPER-2936 - Deleted duplicate code
a02ef3db8 [asutosh936] ZOOKEEPER-2936 - Removed duplicate code

hanm/zookeeper,maoling/zookeeper,hanm/zookeeper,hanm/zookeeper,arshadmohammad/zookeeper,ralgond/paxoskeeper,apache/zookeeper,arshadmohammad/zookeeper,maoling/zookeeper,maoling/zookeeper,arshadmohammad/zookeeper,ralgond/paxoskeeper,ralgond/paxoskeeper,ralgond/paxoskeeper,apache/zookeeper,ralgond/paxoskeeper,hanm/zookeeper,ralgond/paxoskeeper,apache/zookeeper,apache/zookeeper,arshadmohammad/zookeeper,apache/zookeeper,ralgond/paxoskeeper,ralgond/paxoskeeper,apache/zookeeper,arshadmohammad/zookeeper,ralgond/paxoskeeper,hanm/zookeeper,arshadmohammad/zookeeper,apache/zookeeper,arshadmohammad/zookeeper,hanm/zookeeper,arshadmohammad/zookeeper,maoling/zookeeper,maoling/zookeeper,hanm/zookeeper,maoling/zookeeper,maoling/zookeeper,maoling/zookeeper,apache/zookeeper,hanm/zookeeper