Autocomplete refactor