test + small rewrite