Maybe just bracket the `extend`/`include` and `included` in the `if`.