added multi-threaded support to templates and stratums