extended template system and updated examples