Refactored typeahead rendering