Worked on template switch