template system is almost done