Extracted randomNumberGenerator as a private field.