rewrite fragments a bit