I think I'd roll the `params[:search][:query].present?` bit into a helper with a descriptive name.