wrap farms and typeahead code into the same callback