templatizing the layout