Better and simplified support for state restore on rotate