update templates, abstract autocomplete out into its