Cleanup detectHistoryStatus()