Extend template function for underscore