Improved state machine by separating display and restore events