Some improvemnts on control structure

Improvments on control structure for the method title in view helper.
This is just to simplify the syntax and making it shorter. Based on
notes in issue #2743.
Small fix.

#2743