template rewritten