some rewrites