Refactored template_snippet_test.