Can you not break here?  You only need this once, right?  Or even return and avoid isModule entirely, and return false out the back.