Move main to the template.