separate discovery functions to new file