added template functionality for views