make toRTree take a function rewriting Styles