minor build refactorings
ported motor setup into main