Rewrite ready function