refactor(typeahead): rearrange methods

An attempt to make things clearer.