better structure of template