nit: turn this into a helper function in the pre-amble so that you don't have to repeat it multiple times.