refactoring HistoryWidget