templatizing the demo