breakout template selection into partial for support of #835