refactored testing framework