I just found a much more ergonomic and powerful technique of shifting my grip. When my body is upright I have my thumbs wrapped under the handlebar for a powerful grip. When leaned forward and my hips are close to the handlebar (for ascents and accelerations) I bring my thumbs up and rest them on the top of the handlebar (pointing at each other). It's a subtle change but it feels much better.
And as a general point it took me a while to figure out how to orient my right hand for firm grip and effective braking. I've found the gripping the handlebar with my right thumb and pointer finger while using the other three digits to squeeze the brake lever keeps me firmly on the handlebar with enough leverage on the brake lever to control the brakes (and without those three fingers on the handlebar I can squeeze the brake lever all the way in without running into those fingers; very important for strong braking).