remember templates and their contexts