Using the memento pattern