Rewrite to be more lean