template expansion library