Refactored autocomplete stuff
Merge branch 'refactoring'