Move logic to executeRsync function