small rewrite