You're repeating `params[:search]` a lot here, maybe a `search_params` method would be clearer?