Refactored test code to use a different testing strategy