template engines and how rendering works