template system working