Factor out common redirect