Rewrite adding and editing