Improved loading of state