Removed more duplicated test code.