smaller rewrite