Testcase randomization refactoring.