[Refactoring] Reorder TemplateInstance member functions

Today, the work of these functions is so clear, then this arrangement is reasonable to me.