Rewrite for modularity