extract inner class
add tests for degradation callback logic