Refactored the codec test framework