Concentrated base defense logic in one place

Removes code duplication.
Merge pull request #490 from cfailde/tidy_up

Concentrated base defense logic in one place