Restructure template