Reuse more code in test cases.