The problem with electronics on bikes is what to do with the excess wiring; the problem multiplies with computer control of anything, like on my Trek Smover, and breeds further complications with a custom installation of an electric motor and its multitudinous control and power wires running hither and thither. Fortunately I discovered a solution.
First you need to decide where the main control nexus is, because that will shoot out the maximum number of wires, like snakes on Medusa's head. Then you need to raid an obsessively tidy person's computer-room. Finally you need a third hand, prehensile toes like chimpanzee, or a good selection of vice grips to implement my solution.
On the Trek (a fully automatic gearbox and suspension and lamp system, for those who don't know:
http://coolmainpress.com/BICYCLINGsmover.html ) the main control computer was under the downtube but it on and near the handlebars that the maximum number of electrical lines ran between various control switches. So I collected all the control lines together, folded surplus length back or down the conductor, held it all together with tie wraps, and then robbed a complicated computer system of its grey segmented cable routing system, which I wrapped around this by now thick conglomeration of cable on the bike. (The bike had come from Trek's Benelux factory with right-length wires, but they were all cut for a sportsman leaning forward. I sit upright on my bike, like a human being, and the only lines Trek had available for my reengineering job -- which, plus more goodies, they supplied free of charge -- were too long, and the internals too fine to cut and solder. Here's a photo, on which you would hardly notice the cable if I didn't point it out: I've never heard a single comment about it from people I cycle with -- they assume it is an integral part of the bike; I got lucky with the colour matching. The tube runs from the handlebar to the bottom of the head tube, where the standard routing down the fork and the downtube takes over.
When I electrified my Utopia Kranich the second time, I didn't have to ask for longer wires: all Bafang central motor wiring is too long, in some instances grotesquely so -- except, bizarrely, the wire to the battery, which I had to extend. Bafang unified all the wires up the downtube from the control board in the bottom bracket motor to the handlebar but the handlebar itself was rat's nest of bifurcating cables and plugs. Because of medical problems, I rode the bike for several months before I did the tidying work, and each time I was disturbed by the untidy wiring. You'll feel a lot better when you've done the work, Jim! Once able to bend over the bike, I did my thing with tie wraps and computer tidy, folding surplus wires double and making a thicker cable which ran behind the handlebar bag and again down to the junction of head tube with the downtube (the Kranich has a whole bunch of "downtubes") where Utopia's own beautiful custom machined cable routing system took over.