Genericize template structure