serious refactoring of the views
removed useless function $template