updated template validation functions; added and modified template tables