basic typeahead functionality
refactored typeahead functionality