I need to make this function generic. so that to avoid condition in response. passing key through parameters is an option but I am not sure how can i use it?
a