template resturcturing