using the MemoRewriter