This aretegenic (virtue producing) function of theology was at the heart of theology prior to modernity.
Wikipedia foundation.