Refactor GuardTest