Split out the analysis updating code into a helper function. No intended