Rewrite functor tutorial.