Refactored testing