Rewrote the templates