Enable PWM for motors
Code refactoring