Added state save, restore and temporary work methods.