Split the applyRedirect method for readability.

Change-Id: I1ae5245073fe93f77bae5b20e67fee3846c94e38
Merge "Split the applyRedirect method for readability."