be a bit smarter when processing template info