unity – How can I make one single method for lerping for many cases?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TestIK : MonoBehaviour
{
    protected Animator animator;

    public bool ikActive = false;
    public Transform headObj = null;
    public Transform lookObj = null;

    private bool changeWeight = false;
    private float t = 0;
    private float value = 0;

    void Start()
    {
        animator = GetComponent<Animator>();
    }

    //a callback for calculating IK
    void OnAnimatorIK()
    {
        if (animator)
        {

            //if the IK is active, set the position and rotation directly to the goal. 
            if (ikActive)
            {
                t = 0f;

                changeWeight = false;
            }

            //if the IK is not active, set the position and rotation of the hand and head back to the original position
            else
            {
                changeWeight = true;
            }
        }
    }

    private void Update()
    {
        if (changeWeight == true)
        {
            t += Time.deltaTime / 0.5f;
            value = Mathf.Lerp(1f, 0f, t);

            animator.SetLookAtWeight(value);
        }

        // The opposite lerp if no target

        /*
         * if (lookObj != null)
                {
                    animator.SetLookAtWeight(1, 1, 1, 1, 1);
                    animator.SetLookAtPosition(lookObj.position);
                }*/
    }
}

The part in the bottom that marked to be off use I want it to be also using a Lerp.

This part :

if (lookObj != null)
                {
                    animator.SetLookAtWeight(1, 1, 1, 1, 1);
                    animator.SetLookAtPosition(lookObj.position);
                }

I want to lerp all the values in the animator.SetLookAtWeight from 0 to 1. So it will change smooth slowly to the target and not at once.

I tried before an it was working but I had to add more variables for the second Lerp.

How can I make a method that I will be able to use for lerp in some places instead making each time new variables ?

The idea is to be able to control individual objects using lerp with one method.

Example :

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TestIK : MonoBehaviour
{
    protected Animator animator;

    public bool ikActive = false;
    public Transform headObj = null;
    public Transform lookObj = null;

    private bool changeWeight = false;
    private float t = 0;
    private float value = 0;

    private float value1 = 0;
    private float t1 = 0;

    void Start()
    {
        animator = GetComponent<Animator>();
    }

    //a callback for calculating IK
    void OnAnimatorIK()
    {
        if (animator)
        {

            //if the IK is active, set the position and rotation directly to the goal. 
            if (ikActive)
            {
                t = 0f;

                changeWeight = false;
            }

            //if the IK is not active, set the position and rotation of the hand and head back to the original position
            else
            {
                changeWeight = true;
            }
        }
    }

    private void Update()
    {
        if (changeWeight == true)
        {
            t += Time.deltaTime / 0.5f;
            value = Mathf.Lerp(1f, 0f, t);

            animator.SetLookAtWeight(value);
        }

        if (lookObj != null)
        {

            t1 += Time.deltaTime / 0.5f;
            value1 = Mathf.Lerp(0f, 1f, t1);

            animator.SetLookAtWeight(value1, value1, value1, value1, value1);
            animator.SetLookAtPosition(lookObj.position);
        }
    }
}