I don't know. There is a bit of duplication of this logic in reporters; but I cannot think of a clean solution to DRY it.