I have a function mentioned below, i have to do some optimization on it.
This function is used to make some data like a payload based on the arguments that i passed into