Updated the way in which templates are added to the system;