Improve history management.