Rewrite templates and styles