determine template