- Fix memory leaking issue -  fix the return type of getMotorByType() function - some codes refactor