More updates for template system