added template-rendering function to context