state management improvements