use test discover, refactored implementation