Refactored testing class