Needs documentation. I also changed the template logic function to a real function instead of the anonymous function it was (templateLogic()).