one function view for all template