update to use templates