Favor early returns

Modified code to return early on pass/fail conditions.