finally refactor out long-overdue utility method