add template injection mechanism