Updated threads 'controller' to store template data on the session temporarily.