factored the search core and make grid search more aggro