rework and adding of history retrieval