Create deduping object in templates for clearer scope