Help with improving, dynamisation of Input code

Hi for last 3 days i am working on custom input manager bcz of really bad default one.
It is in working condition but iam pretty unsatisfied with hardcoded parts unnecesary parts and iam just too over to realize solution. Iam linking whole script [129212-ncinput.zip|129212]

Main part you can see

public class ModTemplate
    {
        public bool isJosystick = false;
        public bool connected = false;
        public PlayerIndex jNum;
        // public Dictionary<Action, string> template = new Dictionary<Action, string>();
        [SerializeField]
        public static Action[] template156;
    }

    public static ModTemplate playertemp = new ModTemplate();

I tried to integrate dynamic Actions but i would also need editor so i dropped editor and iam actually figuring out this.

static private Action GetInternalAction(template actual, string actionname)
    {
        if (actionname == "horizontal")
        {
            return actual.horizontal;
        }
        if (actionname == "vertical")
        {
            return actual.vertical;
        }
        if (actionname == "firebtn")
        {
            return actual.firebtn;
        }
        if (actionname == "jumpbtn")
        {
            return actual.jumpbtn;
        }        
        if (actionname == "usebtn")
        {
            return actual.usebtn;
        }
        if (actionname == "changebtn")
        {
            return actual.changebtn;
        }
        else
        {
            return null;
        }
        
    }

Iam 100% sure this can be somehow shrinked to 1line

 static ButtonState GetPrevJButton(string button)
    {
        
        if (button == "A")
        {            
           return prevState.Buttons.A;
        }
        if (button == "B")
        {
            return prevState.Buttons.B;
        }
        if (button == "X")
        {
            return prevState.Buttons.X;
        }
        if (button == "Y")
        {
            return prevState.Buttons.Y;
        }
        if (button == "Lstick")
        {
            return prevState.Buttons.LeftStick;
        }
        if (button == "Rstick")
        {
            return prevState.Buttons.RightStick;
        }
        if (button == "Lshoulder")
        {
            return prevState.Buttons.LeftShoulder;
        }
        if (button == "Rshoulder")
        {
            return prevState.Buttons.RightShoulder;
        }
        if (button == "Back")
        {
            return prevState.Buttons.Back;
        }
        if (button == "Start")
        {
            return prevState.Buttons.Start;
        }


        if (button == "DpadUp")
        {
            return prevState.DPad.Up;
        }
        if (button == "DpadDown")
        {
            return prevState.DPad.Down;
        }
        if (button == "DpadLeft")
        {
            return prevState.DPad.Left;
        }
        if (button == "DpadRight")
        {
            return prevState.DPad.Right;
        }


        else
        {
            return prevState.Buttons.LeftStick;
        }
    }
    static ButtonState GetJButton(string button)
    {

        if (button == "A")
        {
            return state.Buttons.A;
        }
        if (button == "B")
        {
            return state.Buttons.B;
        }
        if (button == "X")
        {
            return state.Buttons.X;
        }
        if (button == "Y")
        {
            return state.Buttons.Y;
        }
        if (button == "Lstick")
        {
            return state.Buttons.LeftStick;
        }
        if (button == "Rstick")
        {
            return state.Buttons.RightStick;
        }
        if (button == "Lshoulder")
        {
            return state.Buttons.LeftShoulder;
        }
        if (button == "Rshoulder")
        {
            return state.Buttons.RightShoulder;
        }
        if (button == "Back")
        {
            return state.Buttons.Back;
        }        
        if (button == "Start")
        {
            return state.Buttons.Start;
        }
        
        if (button == "DpadUp")
        {
            return state.DPad.Up;
        }
        if (button == "DpadDown")
        {
            return state.DPad.Down;
        }
        if (button == "DpadLeft")
        {
            return state.DPad.Left;
        }
        if (button == "DpadRight")
        {
            return state.DPad.Right;
        }


        else
        {
            return state.Buttons.RightStick;
        }
    }

Same these 2

And should i even use static i still need to have it put atleast once somewhere to tick the update.
Any suggestions?

Try:

Return Input.inputString