Added the define template function.