refactor sync service