refactoring a bad test