refactor search autocomplete ajax with framework