cleanup some legacy code
save state on rotation