refactor to factory pattern in sync_rsync
refactor codes in sync_rsync