Rework the sync stuff a bit