refactored vsserver and vsreplicaserver