Add a template main class