moved some parts of template to include