Note that I removed this function because it was only called in a couple of places.