added templatization