use handle structs to read templates only once