Reduced duplication in test code.