refactoring discovery test