Improve ErrorStateRegistry