cleanup template lookup
implement autocomplete/lookups