Reduce code duplication in GaussianIntegral