Promise rewrite