Probably all these various sync checks can get moved into middleware.