Improve template helpers