rewrite everything & add urlsafe parts