     Template.instance()?.get('component') or null
 
   firstNode: ->
-    @templateInstance.firstNode
+    @_componentInternals.templateInstance.firstNode
 
   lastNode: ->
-    @templateInstance.lastNode
+    @_componentInternals.templateInstance.lastNode
 
 # We copy utility methods ($, findAll, autorun, subscribe, etc.) from the template instance prototype.
 for methodName, method of Blaze.TemplateInstance::
   do (methodName, method) ->
     BlazeComponent::[methodName] = (args...) ->
-      @templateInstance[methodName] args...
+      @_componentInternals.templateInstance[methodName] args...
 
 argumentsConstructor = ->
   # This class should never really be created.


      # We on purpose do not reuse helpers, events, and hooks. Templates are used only for HTML rendering.

      registerHooks template,
        onCreated: ->
          # @ is a template instance.

    # and this is this dependency mixin, the view might already be created or rendered and callbacks were
    # already called, so we should call them manually here as well. But only if he view has not been destroyed
    # already. For those mixins we do not call anything, there is little use for them now.
    unless @_componentInternals.templateInstance?.view.isDestroyed
      mixinInstance.onCreated?() if not @_componentInternals.inOnCreated and @_componentInternals.templateInstance?.view.isCreated
      mixinInstance.onRendered?() if not @_componentInternals.inOnRendered and @_componentInternals.templateInstance?.view.isRendered

    # To allow chaining.
    @
