Refactoring, cleaned up search algorithm usage.