improvements for shard/replica handling