rewrite templates and add css