fix up mapping to templates to use ResultSet
provision debug tools