Small refactor of RedirectHandler.