Rewrite with objects