refactors Search class