Refactor HistoryView