Refactor PWM examples