major changes for templates and implementation