Refactor HistoryPanel