extracted searchController logic into Search class