small refactor on initMotor