refactor the test