Refactored the test methods.