changed View and Controller to template class