updated use of templates