Refactoring of rsync stage