Extended state handling to avoid repetition.