Rename sync function to _sync