part 1 of search template system