rendering templates and redirecting actions