moved html out and modified rewrites