Motor driver refactor