refactor sync task