rewrits and fix