Template helper improvements