Refactor history-store example