Added replica sets support