fixing autocomplete style, refactoring