Add template expansion