first part of templates router