deferred template loading + cache