further streamlining code strictly for use in autocomplete