Can't refactor the function with variable arguments