Live demo: more generic rewrite