added new template system