added support for second view, templates, lightbox