apply tweak from other codebase, to preserve templates in context of multiple. not sure exactly why it works, need to review. also uses require(lodash) which won't be generically available.