refactored meta t test code