Separated code for state, Flash, and deprecation.