Add resync and refactor sync

Change-Id: I480b477f0fa9cb7f8b9af9b231c9ce7783f404c7