Add the life expectancy to the function factory