4.0 rewrite