Using a lambda here seems overly complex. I'd probably simplify it and just use a simple separate method. If you don't want to rewrite this, that's ok. But could we have a test for this failover feature please?