restructuring views -with templating