Move typeahead-stuff out of typeahead