feels like this ought to be a utility Function ... but where?