Performance improvements to layout restoration