Removed code duplication in the safeguards
Removed more duplication
Merge pull request #61 from stof/remove_duplication

Removed code duplication in the safeguards