Used to create state based on other state.