Abstract redirect lookup so it can be tested

7 jobs for add/unit-tests in 3 minutes and 25 seconds (queued for 2 seconds)