Version with a main template and tables working