Re-arrange history update code