Refactoring HistoryActivity.