refactoring a test