Refactors ring search.