How do I get rid of duplication

I wrote the code based on these two lines:

Adafruit_PWMServoDriver pwm0 = Adafruit_PWMServoDriver(0x40);
Adafruit_PWMServoDriver pwm1 = Adafruit_PWMServoDriver(0x41);

I didn't know how to move the data through both boards without duplication.

I'm okay with two arrays, or one array for data. Just wanted to get rid of the duplication of code in case a third PCA 9685 servo driver board (pwm2) was added.

It's going to take me a little while to go through these suggestions.

Thanks,

Mandy