refactored going back in history, and general history support