Use guard; refactored testing helpers