memento pattern.