Refactored some testcases.