Implemented new template system.