Maybe this was the moment to turn this (and the next one) into a function that does this calculation that we have all over the place?