redefine template functions