Quote
... but there was a lot of "afterthinking"

Indeed, there was! And is.


I could be wrong, but my recollection is that Samuel F. B. Morse invented the relay, for the purpose I described above.