Improve the resetHistory method.