Refactor target searcha little