I wonder if this shouldn't be in fog-core somewhere?