ISSUE-5201: Moving exit; out of the method.