I think numberOfShards and numberOfReplicas should be stored in a variable and then reused. For example, if `numberOfReplicas` is implemented as `between(0, 3)` the `if` statement might return true because it returned a value of 2 and then a value of 0 will be put in the settings.