turned typeahead funcitons into model and view