refactored the test