Added the ability to use templates instead of directly loading data