HTC could have done a couple of things, especially when they were on top. They should have fought harder for the tablet market. They should have fought harder for the big phone market. They should be fighting harder for tech wearables, VR, sports cams, etc, but they aren't. They should have done more with Beats when they had them. And, they should have done better with branding.
As far as phones go, HTC should do what Samsung and Apple aren't. Give us expandable memory and battery. Give us the option of pure android without rooting.