Move the layout into a template