Refactor rdiff to integrate python tweak