test and code refactored in search graph