small changes to internal sync to make it a bit clearer