Changed templates to make better use of 'static' variable.