Simplify extends logic.

You assign to `module` twice. Better style would be an `else`.