Autocomplete factory refactoring.