refactoring motor gang controls

refactoring motor gang controls