refactor codes in sync_rsync to decorators