Refactoring and preparing for circle search.