Extend template library with css and js
Add isset condition to avoid error
Use templates for all views