Refactored autocompleter