Nit: this could simply fall through to the end of the nested conditional, where the last two statements of the function are identical.