query helper accept function as parameter which should return parameters for query refactor code with queryhelper