Updating code for rewrite.