Refactored to use global template helpers