Extract out tag templating.