refactor the tests