templateManager: declare table beforehand for recursion later