Before I rewired that entire bike with new wiring I would go over it and check for rot and or abrasion under the rear fender and around the steering neck.
If all looks good then trim off old ends strip back copper about 1/4 to 3/8". Now look at copper wiring on new ends. Is it green or black from corrosion or heat?
If so strip some more back until you get to clean copper. If wire is too short or toast then it will need that run of wire replaced.
You can buy these connection blocks at most electronic supply houses for contractors. Mine was long enough to redo 3 mopeds.
In your picture the the wire cover needs trimmed back to relieve the wires pulling tight on connection blocks. Take scissors and carefully cut where indicated. Straight down one side, then carefully around outside of wires.