Rework of the original RBeautify script