refactor ResourcesController#autocomplete with hot spots for adaptation