some small rewrite