We give a three-fold upgrade to the rearrangement lemma (pioneer by Connes-Tretkoff-Moscovici) base on the functional analytic ground laid by Lesch. First, we show that the building blocks of the spectral functions appeared in the lemma belong to a class of multivariable hypergeometric functions called Lauricella functions of type D, which includes Gauss hypergeometric functions and Appell's F1 functions as one and two variable subclass respectively. Second, we extend previous results from dimension two to arbitrary dimensions by absorbing the dimension into the parameters of those hypergeometric functions. Third, the highlight of this paper is a reduction formula for the multivariable functions to the Gauss hypergeometric functions using iterated divided differences and differentiations. As for applications, we take perturbed Laplacian operator (the degree zero part that acts on functions) in Connes-Moscovici's paper as an example and extend the computation of the associated modular curvature (functional density of the second heat coefficient) two noncommutative tori of arbitrary dimension. The two spectral functions are written at first as linear combinations of Gauss and Appell's hypergeometric functions. Based on the reduction to Gauss hypergeometric functions, we are able to further derive theirs explicit expressions as functions in the dimension parameter. At last, symbolic verification shows that the two spectral functions fulfill the corresponding Connes-Moscovici type functional relation, even when the dimension parameter takes real-value, which provides a strong confirmation for the validation of our computation.