cleaned up template helpers