refactoring discovery to use async task