implement template