Improve state persistence