Still working on the object creation for templates.  This all needs refactoring.