template: update deprecated function