make redirect logic a little more clear