More modular rewrite