prepare independent environment for template evaluation