How to avoid state synchronization bugs and complexity with derived state.