template functions update