added template system and examples