Refactor this series of evolutionary hacks:
1) Bug: Warm-bloodedness means that testicles now don't work as well. Reasonable patch: make them more resistant to body heat (this worked for ovaries, apparently). Actual hack patch: hang them on the outside of the body so they can stay cooler, and also add a complicated mechanism to make them get closer or further away as the temperature changes.
2) New bug introduced by 1): Testicles on outside of body are now extremely vulnerable to damage. Reasonable patch: enclose them in some kind of hard cartilage or bone shell. Actual hack patch: make them hurt really bad if they get hit, so their owner takes extreme caution to protect them.