Beginning of template system.